// JavaScript Document
var strloading = "Please waite...";
function confirm_check(url,mess)
{
	anser=confirm(mess)
	
	if(anser==true)
		window.location = url
}
function linkto(url)
{
	window.location = url
}
function checknumber(o)
{
	message="Chi duoc nhap so"
	if(isNaN(o.value))
	{
		error_message ="* " + message + "\n"
		alert(error_message)
		o.value=''
		//o.select()
		return false
	}
	else return true
}
function checkemty(o,message)
{	
	if(o.value=="")
	{
		o.focus()
		error_message ="* " + message + "\n"
		alert(error_message)
		return true
	}
	else return false
}
function checkemail(e,message)
{
	var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
	var returnval=emailfilter.test(e.value)
	if (returnval==false)
	{
		alert(message)
		e.select()
		return false
	}
	return true
}
function checkpassword(pass,cpass,message)
{
	if(pass.value!=cpass.value)
	{
		alert(message)
		return false
	}
	return true
}
function creatTextBox(name,value,stye)
{
	return "<input name='"+name+"' value='"+value+"' "+stye+" />"
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos)
{
	if(pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else 
		if((pos!="center" && pos!="random") || pos==null)
		{
			LeftPosition=0;
			TopPosition=20
		}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);}
// -->
function xemphieu(url)
{
	//alert(url)
	NewWindow(url,'mywin','600','340','yes','center')
}
function printpage()
{
	window.print()
}
function display(objname)
{
	o = document.getElementById(objname);
	if(o.style.display == 'none')
	{
		o.style.display = '';
	}
	else
		hidden(objname)
}

function hidden(objname)
{
	o = document.getElementById(objname);
	o.style.display = 'none';
}
